<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>简介</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="book.mysqlnd-memcache.html">mysqlnd_memcache</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqlnd-memcache.quickstart.html">Quickstart and Examples</a></div>
 <div class="up"><a href="book.mysqlnd-memcache.html">mysqlnd_memcache</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="intro.mysqlnd-memcache" class="preface">
  <h1 class="title">简介</h1>
  <p class="para">
   The mysqlnd memcache plugin (<em>mysqlnd_memcache</em>) is an PHP
   extension for transparently translating SQL into requests for the
   MySQL InnoDB Memcached Daemon Plugin (server plugin). It includes
   experimental support for the MySQL Cluster Memcached Daemon. The server
   plugin provides access to data stored inside MySQL InnoDB (respectively
   MySQL Cluster NDB) tables using the Memcache protocol. 
   This PHP extension, which supports all PHP MySQL extensions that use
   <a href="book.mysqlnd.html" class="link">mysqlnd</a>, will identify tables exported in
   this way and will translate specific SELECT queries into Memcache requests. 
  </p>
  <div class="mediaobject">
   
   <div class="imageobject">
    <img src="images/55c7816ef6df6821f05678a68b4e4e63-mymemflow.png" alt="mysqlnd_memcache data flow" width="813" height="276" />
   </div>
  </div>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    This plugin depends on the MySQL InnoDB Memcached Daemon Plugin. It is not
    provided to be used with a stand-alone Memcached. For a generic query cache
    using Memcached look at the <a href="book.mysqlnd-qc.html" class="link">mysqlnd query
    cache plugin</a>. For direct Memcache access look at the
    <a href="book.memcache.html" class="link">memcache</a> and
    <a href="book.memcached.html" class="link">memcached</a> extensions.
   </p>
  </p></blockquote>
  <p class="para">
   The MySQL native driver for PHP is a C library that ships together with
   PHP as of PHP 5.3.0. It serves as a drop-in replacement for the
   MySQL Client Library (libmysqlclient). Using mysqlnd has
   several advantages: no extra downloads are required because it&#039;s bundled with PHP,
   it&#039;s under the PHP license, there is lower memory consumption in certain cases, and
   it contains new functionality such as asynchronous queries.
  </p>
  <p class="para">
   The <em>mysqlnd_mmemcache</em> operates, for the most part,
   transparently from a user perspective. The mysqlnd memcache
   plugin supports all PHP applications, and all MySQL PHP extensions.
   It does not change existing APIs. Therefore, it can easily be used with
   existing PHP applications.
  </p>
  <p class="para">
   The MySQL Memcache plugins add key-value style access method for data stored
   in InnoDB resp. NDB (MySQL Cluster) SQL tables through the Memcache protocol.
   This type of key-value access if often faster than using SQL.
  </p>
  <div class="section" id="mysqlnd-memcache.key-features">
   <h2 class="title">Key Features</h2>
   <p class="para">
   The key features of PECL/mysqlnd_memcache are as follows.
   </p>
   <p class="para">
    <ul class="itemizedlist">
     <li class="listitem">
      <p class="para">
       Possible performance benefits
      </p>
      <p class="para">
       <ul class="itemizedlist">
        <li class="listitem">
         <p class="para">
          Client-side: light-weight protocol.
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          Server-side: no SQL parsing, direct access to the storage.
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          Please, run your own benchmarks! Actual performance results are
          highly dependent on setup and hardware used.
         </p>
        </li>
       </ul>
      </p>
     </li>
    </ul>
   </p>
  </div>

  <div class="section" id="mysqlnd-memcache.limitations">
   <h2 class="title">Limitations</h2>
   <p class="para">
    The initial version is not binary safe. Due to the way the MySQL Memcache
    plugins works there are restrictions related to separators.
   </p>
   <p class="para">
    Prepared statements and asynchronous queries are not supported. Result set
    meta data support is limited.
   </p>
   <p class="para">
    The mapping information for tables accessible via Memcache is not cached
    in the plugin between requests but fetched from the MySQL server each time 
    a MySQL connection is associated with a Memcache connection. See
    <span class="function"><a href="function.mysqlnd-memcache-set.html" class="function">mysqlnd_memcache_set()</a></span> for details.
   </p>
  </div>

  <div class="section" id="mysqlnd-memcache.name">
   <h2 class="title">On the name</h2>
   <p class="para">
    The shortcut <em>mysqlnd_memcache</em>
    stands for <em>mysqlnd memcache plugin</em>.
    Memcache refers to support of the MySQL Memcache plugins
    for InnoDB and NDB (MySQL Cluster). The plugin is not
    related to the Memcached cache server.
   </p>
  </div>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="book.mysqlnd-memcache.html">mysqlnd_memcache</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqlnd-memcache.quickstart.html">Quickstart and Examples</a></div>
 <div class="up"><a href="book.mysqlnd-memcache.html">mysqlnd_memcache</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
